<template>
	<tm-app ref="app">
		<tm-navbar title="评价帮手" color="orange" linear="right" beforeBack="true" hideHome="true"></tm-navbar>

		<tm-comment v-for="(item,index) in list" :key="index" author="微信用户评价" :avatar="item.avatar"
			:time="item.addtime" :content="item.content">
			<template v-slot:actions>
				<view class="flex flex-row norwap">
					<view class="flex flex-row flex-center pl-16">
						<tm-rate color="orange" size="20" readonly :defaultValue="item.star" showLabel></tm-rate>
					</view>
				</view>
			</template>
		</tm-comment>



	</tm-app>
</template>


<script lang="ts" setup>
	import { ref, nextTick } from "vue"
	import { onLoad } from "@dcloudio/uni-app"
	import { getBsEvalById } from '@/api/order'

	const id = ref("");
	const list = ref([]);

	onLoad((e) => {
		console.log(JSON.stringify(e));
		id.value = e.id;
		loadOrderEval();
	})


	const loadOrderEval = async () => {
		let param = { "id": id.value };
		const result = await getBsEvalById(param);
		// console.log(JSON.stringify(result));
		list.value = result;
	}
</script>